#!/bin/bash
#############################################################
# Jenkins control script
#   Author: Christian Askeland, SINTEF Medical Technology
#   Date:   2013.12.05
# Run this script as a bridge form Jenkins XShell plugin to python calls in the Mac/Linux case.
# Usage: path/to/run_python <target_os> <cx_envscripts_path> "<python_script> <arguments>"
#   Note the hyphens around the third argument containing script name + args.
# 

echo "Bash arguments: " $*

COMMAND=$3
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
DIR="$( cd "$( dirname "$0" )" && pwd )" 

# auto propagate errors, set stoud redirect on
set -e
set -x
python -u $DIR/$COMMAND
set +x

